package org.example.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class StudentDao {
    /***
     * 班级级联删除提醒
     * @throws SQLException
     */
    public boolean getStudentByClassId(Connection con, String classId) throws SQLException {
        String sql="select * from t_student where classId=?";
        PreparedStatement pstmt=con.prepareStatement(sql);
        pstmt.setString(1, classId);
        ResultSet rs=pstmt.executeQuery();
        if(rs.next()) {
            return true;
        }else {
            return false;
        }
    }
}
